package cl.orangepeople.whyem.portal.backend.api.impl;

import java.math.BigDecimal;
import java.text.NumberFormat;
import java.util.Locale;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cl.orangepeople.whyem.portal.backend.api.DebtsService;
import cl.orangepeople.whyem.portal.backend.dto.debts.DebtDTO;
import cl.orangepeople.whyem.portal.backend.dto.debts.DebtDataBean;
import cl.orangepeople.whyem.portal.backend.dto.debts.DebtDataDetails;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class DebtsServiceImpl implements DebtsService {

    private static Logger logger;
    private static String[] clientsID;
    private static String[] paymentNumbers;

    static {
	logger = LoggerFactory.getLogger(DebtsServiceImpl.class);
	clientsID = new String[] { "15956647", "158011638", "111111111", "15801163", "11111111" };
	paymentNumbers = new String[] { "12345678" };
    }

    public DebtDataBean getDebtDetails(DebtDTO paymentData) {
        String clientID = paymentData.getClientID();
        String paymentNumber = paymentData.getPaymentID();

        Object[] objectToBeLogged = new Object[]{clientID, paymentNumber};
        logger.debug("Client id: {}, payment number: {}", objectToBeLogged);

        DebtDataBean bean = new DebtDataBean();
        DebtDataDetails newPaymentData = new DebtDataDetails();

        bean.setPaymentDetail(newPaymentData);

        return bean;
    }

    public List<DebtDataBean> getDebtsByClientID(String clientID) {
        List<DebtDataBean> debts = Collections.emptyList();
        return debts;
    }
}
